package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.hardware.components.PowerSupply;

public class PowerSupplyMapper implements RowMapper<PowerSupply> {

	@Override
	public PowerSupply mapRow(final ResultSet result, final int row) throws SQLException {
	    	    
	    PowerSupply powerSupply = new PowerSupply(result.getString("name"),	                                    
	                                     result.getInt("capacity"),
	                                     result.getInt("prize"));	
	    
	    powerSupply.setIdComponent(result.getInt("idComponent"));
		return powerSupply;
	}

}
